package com.stu.controller;

import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

/**
 * @author MI
 * @ClassName ErrController.java
 * @createTime 2022年01月05日 18:08:00
 */
@Slf4j
@Api(tags = "全局异常测试")
@Validated
@RestController
@RequestMapping("/err")
public class ErrController {
    @GetMapping("/date")
    public LocalDateTime dateTime() {
        System.out.println("ErrController.dateTime");
        System.out.println(1 / 0);
        return LocalDateTime.now();
    }

    @GetMapping("/void")
    public void aVoid() {
        System.out.println("ErrController.dateTime");
        // System.out.println(1 / 0);
    }
}
